<!--<?php
print <<<EOT
-->

<div class="m"></div>
<!--
EOT;
if($action == 'add' || $action == 'edit')
{print <<<EOT
-->
<form action="$basename?adminjob=set_type" method="post">
<div class="t">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="head">
	<td colspan="2">新增资源类型</td>
</tr>
<tr class="tr2">
  <td width="20%">类型名称</td>
  <td width="80%">扩展名</td>
</tr>
<tr class="line">
  <td><input name="typename" type="text" class="input" /></td>
  <td><input name="typeext" type="text" class="input" value="" size="90" /></td>
</tr>
</table>
</div>
<center>
	<input name="action" type="hidden" id="action" value="add">
	<input type="submit" name="Submit" value=" 提 交 " class="btn">
	<input type="reset" name="Submit2" value=" 重 置 " class="btn">
</center>
</form>
<!--
EOT;
}else{
print <<<EOT
-->
<form action="$basename" method="post">
<div class="t">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="head">
	<td colspan="2">资源类型设置[<a href="$basename?adminjob=set_type&action=add">新增类型</a>]</td>
</tr>
<tr class="tr2">
  <td width="20%">类型名称</td>
  <td width="80%">扩展名</td>
</tr>
<!--
EOT;
foreach($restype as $r){
$r[typeext] = implode(',', $r[typeext]);
print <<<EOT
-->
<tr class="line">
  <td><input name="typename[$r[typeid]]" type="text" class="input" value="{$r[typename]}" /></td>
  <td><span class="fr">
  <a href="$basename?adminjob=set_type&edit=$r[typeid]"><img src="images/admin/edit3.gif" align="absmiddle" title="编辑此资源类型" /></a>
	<a href="$basename?adminjob=set_type&remove=$r[typeid]" onclick="return removeRestype('$r[typeid]');"><img src="images/admin/delete.png" align="absmiddle" title="删除此资源类型" /></a></span><input name="typeext[$r[typeid]]" type="text" class="input" value="$r[typeext]" size="90" /></td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
</div>
<center>
	<input name="edit" type="hidden" id="edit" value="1">
	<input type="submit" name="Submit" value=" 提 交 " class="btn">
	<input type="reset" name="Submit2" value=" 重 置 " class="btn">
</center></form>
<script language="javascript">
function removeRestype(typeid)
{
	return confirm('您确认要删除此种类型么？（该操作并不会对现有资源产生影响）');	
}
</script>
<!--
EOT;
}print <<<EOT
-->

<!--
EOT;
?>-->